<style type="text/css">
a {
	cursor: pointer;
}
.site.form-group .btn-group, .form-group .group.btn-group, .form-group .from.btn-group, .form-group .from_user.btn-group, .form-group .asign_user.btn-group, .priority.form-group .btn-group {
	margin-left: 10px;
}
.site .btn-group .dropdown-toggle {
	min-width: 180px;
	text-align: left;
}
.group.btn-group .dropdown-toggle, .from.btn-group .dropdown-toggle, .from_user.btn-group .dropdown-toggle, .asign_user.btn-group .dropdown-toggle, .priority .btn-group .dropdown-toggle {
	min-width: 160px;
	text-align: left;
}
</style>
<script src="/include/ckeditor/ckeditor.js"></script>
<script src="/include/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	 CKEDITOR.replace( 'editor' );
	 $(".site li a").click(function(){
	     $(".site .text").text($(this).text());
         $(".site input").val($(this).text());
     });
	 $(".group li a").click(function(){
	     $(".group .text").text($(this).text());
	     $(".group input").val($(this).data('id'));
	     $.get("/office/loaduser", {group:$(this).data('id')},
	    	 function(data){
	    	     $(".asign_user .dropdown-menu").html(data.content);
	    	     $(".asign_user .text").text('请选择成员');
		     },'json'
		 );
     });
	 $(".from li a").click(function(){
	     $(".from .text").text($(this).text());
	     $.get("/office/loaduser", {group:$(this).data('id')},
	    	 function(data){
	    	     $(".from_user .dropdown-menu").html(data.content);
	    	     $(".from_user .text").text('请选择成员');
	    	     $(".from_user").removeClass("hidden");
		     },'json'
		 );
     });
	 $(".asign_user li a").live('click',function(){
	     $(".asign_user .text").text($(this).text());
	     $(".asign_user input").val($(this).data('id'));
     });
	 $(".from_user li a").live('click',function(){
	     $(".from_user .text").text($(this).text());
	     $(".from_user input").val($(this).data('id'));
     });
	 $(".priority li a").click(function(){
	     $(".priority .text").text($(this).text());
	     $(".priority input").val($(this).data('id'));
     });
})
</script>
<div class="pageheader">
	<h2>
		<i class="fa fa-sitemap"></i>办公管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>办公管理</li>
			<li class="active">发布需求</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
    <div class="main">
    <form action="/office/updateneed" method="post" class="form-horizontal">
        <?php if ($this->msg):?>
        <div style="margin: 20px 184px;" class="form-group"><?php foreach ($this->msg as $v):?><span class="label label-warning"><?php echo $v;?></span><?php endforeach;?></div>
        <?php endif;?>
        <?php $qaitem = $this->qaitem;?>
        <div class="form-group form-inline">
            <label for="Title" class="col-sm-2 control-label">标题：</label>
            <div class="col-sm-10">
                <input type="hidden" class="form-control" name="id" size="100" value="<?php echo $qaitem['id']; ?>">
                <input type="text" class="form-control" name="title" size="100" value="<?php echo $qaitem['title']; ?>">
            </div>
        </div>
        <div class="form-group site">
            <label for="Site" class="col-sm-2 control-label">网站：</label>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="text"><?php echo $qaitem['site']; ?> </span></button>
                <input type="hidden" value="<?php echo $qaitem['site']; ?>" name="site">
                <ul class="dropdown-menu">
                    <li><a>gogoalshop.com</a></li>
                    <li><a>elmontyouthsoccer.com</a></li>
                    <li><a>bestcheapsoccer.com</a></li>
                    <li><a>minejerseys.com</a></li>
                    <li><a>jerseysmark.com</a></li>
                    <li><a>goaljerseys.com</a></li>
                    <li><a>fancybestdeal.com</a></li>
               </ul>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Content" class="col-sm-2 control-label">详情：</label>
            <div class="col-sm-10">
                <textarea id="editor" name="editor" rows="10" cols="50" style="visibility: hidden;display: none;"><?php echo stripslashes($qaitem['content']); ?></textarea>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Needfrom" class="col-sm-2 control-label">需求来自：</label>
            <div class="btn-group from">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="text"><?php echo $qaitem['need_name'];?></span></button>
                <input type="hidden" value="0" name="from">
                <ul class="dropdown-menu">
                    <li><a data-id="1">管理团队</a></li>
                    <li><a data-id="2">运营团队</a></li>
                    <li><a data-id="3">技术团队</a></li>
                    <li><a data-id="4">仓储行政团队</a></li>
               </ul>
            </div>
            <div class="btn-group from_user hidden">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="text">请选择成员 </span></button>
                <input type="hidden" value="<?php echo $qaitem['need_id']; ?>" name="from_user">
                <ul class="dropdown-menu">
                
               </ul>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Needasign" class="col-sm-2 control-label">需求指派：</label>
            <div class="btn-group group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="text">
                    <?php 
                    switch ($qaitem['asign_group'])
                    {
                    	case 1:
                    		echo '管理团队';
                    		break;
                    	case 2:
                    		echo '运营团队';
                    		break;
                    	case 3:
                    		echo '技术团队';
                    		break;
                    	case 4:
                    		echo '仓储行政团队';
                    		break;
                    	default:
                    		echo '请选择团队';
                    }
                    ?>
                    </span>
                </button>
                <input type="hidden" value="<?php echo $qaitem['asign_group']; ?>" name="group">
                <ul class="dropdown-menu">
                    <li><a data-id="1">管理团队</a></li>
                    <li><a data-id="2">运营团队</a></li>
                    <li><a data-id="3">技术团队</a></li>
                    <li><a data-id="4">仓储行政团队</a></li>
               </ul>
            </div>
            <div class="btn-group asign_user">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="text"><?php echo $qaitem['task_name'];?></span></button>
                <input type="hidden" value="<?php echo $qaitem['task_id']; ?>" name="asign_user">
                <ul class="dropdown-menu">
                
               </ul>
            </div>
        </div>
        <div class="form-group priority">
            <label for="Priority" class="col-sm-2 control-label">优先级：</label>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="text">
                    <?php 
                    switch ($qaitem['priority'])
                    {
                    	case 0:
                    		echo '默认等待';
                    		break;
                    	case 1:
                    		echo '比较重要';
                    		break;
                    	case 2:
                    		echo '十分紧急';
                    		break;
                    	default:
                    		echo '请选择优先级';
                    }
                    ?>
                     </span>
                </button>
                <input type="hidden" value="<?php echo $qaitem['priority']?>" name="priority">
                <ul class="dropdown-menu">
                    <li><a data-id="0">默认等待</a></li>
                    <li><a data-id="1">比较重要</a></li>
                    <li><a data-id="2">十分紧急</a></li>
               </ul>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Memo" class="col-sm-2 control-label">备注：</label>
            <div class="col-sm-10">
                <textarea rows="2" cols="100" class="form-control" name="memo"><?php echo $qaitem['memo']; ?></textarea>
            </div>
        </div>
        <div class="form-group form-inline">
            <label for="Memo" class="col-sm-2 control-label">评价：</label>
            <div class="col-sm-10">
                <textarea rows="2" cols="100" class="form-control" name="evaluate"><?php echo $qaitem['evaluate']; ?></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">确定</button>
            </div>
        </div>
    </form>
    </div>
</div>